#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read(){
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 85;
const int mod = 1e9 + 7;

ll qp(ll x,int t){ll res = 1;for(;t;t >>= 1,x = x * x % mod) if(t & 1) res = res * x % mod;return res;}

void upd(int &x){x = x + (x >> 31 & mod);}

int n,a[N],K;
int f[N][N],b[N],fac[N],ifac[N];

int C(int x,int y){return (ll)fac[x] * ifac[y] % mod * ifac[x - y] % mod;}

int main(){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	K = in; for(int i = 1;i <= K;i++) a[i] = in,n += a[i]; f[1][a[1] - 1] = 1;
	for(int i = (fac[0] = 1);i <= n;i++) fac[i] = (ll) fac[i - 1] * i % mod; ifac[n] = qp(fac[n],mod - 2);
	for(int i = n - 1;i >= 0;i--) ifac[i] = (ll) ifac[i + 1] * (i + 1) % mod;
	
	for(int i = 2,s = a[1];i <= K;i++){
		for(int j = 0;j < s;j++)
			if(f[i - 1][j])
				for(int k = 1;k <= a[i];k++)
					for(int l = 0;l <= min(j,k);l++)
						upd(f[i][j + a[i] - k - l] +=
							(ll) f[i - 1][j] * C(a[i] - 1,k - 1) % mod * C(j,l) % mod * C(s - j + 1,k - l) % mod - mod);
		s += a[i];
	}
	printf("%d\n",f[K][0]);
	return 0;
}
